package com.zhouz.admin.app.vo;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhouz.admin.app.util.wrapper.WhereEntityTool;
import com.zhouz.admin.app.util.wrapper.WhereType;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
public class PageVo<T> {


    public IPage<T> getSelectPage(){
        return new Page<T>(this.page,this.limit);
    }
    public QueryWrapper<T> getSelectQuery(){
        return  WhereEntityTool.invoke(this);
    }

    /**
     * 获取数据权限的 查询体
     * @auther: zhangpeng
     * @date: 2019/5/15 10:33
     * @return
     */
 /*   public QueryWrapper<T> getAuthQuery(){
        QueryWrapper<T> authWrapper = new AuthWrapper<>();
        return WhereEntityTool.invoke(this,authWrapper);
    }*/
    /**
     * 获取数据权限的 查询体
     * @auther: zhangpeng
     * @date: 2019/5/15 10:33
     * @return
     */
  /*  public QueryWrapper<T> getAuthQuery(String authKey){
        QueryWrapper<T> authWrapper = new AuthWrapper<>(authKey);
        return WhereEntityTool.invoke(this,authWrapper);
    }*/
    public PageVo() {
        super();
        page = 1;
        limit = 10;
    }

    public PageVo(int page, int limit) {
        super();
        this.page = page;
        this.limit = limit;

    }
    @ApiModelProperty(value="当前页数")
    @WhereType(ignore = true)
    private Integer page;
    @ApiModelProperty(value="一页显示数量")
    @WhereType(ignore = true)
    private Integer limit;


}


